﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CoolCode.Controls
{
    public class ModalDialog : UserControl, IModalDialog
    {
        public event EventHandler Closed;
       
        #region IModalDialog Members

        public void Show(Panel parent)
        {
            Window.ShowDialog(parent, this);
        } 

        public void Close()
        {
            Window.CloseDialog();
            if (Closed != null)
            {
                Closed(this, EventArgs.Empty);
            }
        } 

        #endregion
    }

    public interface IModalDialog
    {
        void Show(Panel parent);
        void Close();
    }

    public interface IModalDialogOpener
    {
        void ShowModalDialog(ModalDialog dialog);

        void CloseModalDialog();
    }

}
